package com.by.service.impl;

import com.by.bean.User;
import com.by.mapper.UserMapper;
import com.by.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author :LYJ
 * @version : 1.0
 * @date : 2025/2/19 20:03
 * @desc :
 * @since : JDK17
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;

    @Override
    public int checkUser(String account) {
        return userMapper.queryUserByUserName(account);
    }

    @Override
    public int save(User user) {
        return userMapper.save(user);
    }

    /**
     * 根据用户账号查询用户角色
     *
     * @param account
     * @return
     */
    @Override
    public List<String> queryUserRole(String account) {
        return userMapper.queryUserRole(account);
    }
}
